<?php

namespace App\Http\Controllers\api;

use App\Http\Controllers\Controller;
use App\Repository\RepositoryInterface\CommissionInterface;
use App\Repository\RepositoryInterface\GroupInterface;
use Illuminate\Http\Request;

class CommissionController extends Controller
{
    //
    protected $commission;

    public function __construct(CommissionInterface $commission){
        $this->commission = $commission;
    }

    /**
     * @param Request $request
     * @return mixed
     * 查询对应团长的佣金
     */
    public function comGroupPrice(Request $request){
        $uid = $request->post("uid");
        $groupPrice = $this->commission->comGroupPrice($uid);
        return $groupPrice;
    }

    /**
     * @param Request $request
     * @return mixed
     * 团长提现功能
     */
    public function priceTure(Request $request){
        $groupDataPrice = $request->post();
        $priceGroupTrue = $this->commission->priceTure($groupDataPrice);
        return $priceGroupTrue;
    }
}
